package com.zyk.leetcode;

/**
 * https://leetcode-cn.com/problems/er-cha-sou-suo-shu-de-di-kda-jie-dian-lcof/
 *
 * @author zhangsan
 * @date 2021/4/3 14:16
 */
public class J54 {

    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;

        TreeNode(int x) {
            val = x;
        }
    }

    public int k, ans;
    public int kthLargest(TreeNode root, int k) {
        this.k = k;
        return this.ans;
    }
    public void midFind(TreeNode root) {
        if(root == null) {
            return;
        }
        // 右树
        midFind(root.right);
        this.k--;
        if(k == 0) {
            this.ans = root.val;
        }
        // 左树
        midFind(root.left);
    }

}
